<template>
	<BaseContainer>
		<el-tabs tab-position="left" v-model="activeName">
			<el-tab-pane v-for="(item, index) in tabsList" :key="index" :label="item.label" :name="item.value"></el-tab-pane>
			<aplid-base-crud
				v-if="activeName == 3"
				:key="activeName"
				ref="crud"
				class="w-100"
				v-bind="activeItem.baseConfig"
				:paramsObj="{ ...(activeItem.paramsObj || {}), ...(activeItem.baseConfig.paramsObj || {}) }"
			>
				<template v-slot:pageName></template>
			</aplid-base-crud>
			<component
				v-else
				:is="activeItem.compont"
				:tableConfig="activeItem.tableConfig"
				:needPigeonhole="false"
				:isComprehensiveQueries="false"
				:moreSearchConfig="''"
			></component>
		</el-tabs>
	</BaseContainer>
</template>

<script setup>
import { baseConfig as TargetValue } from '../elderlyReform/TargetValue'
import familyBedConstruct from '@/views/datacenter/business/familyBedConstruct/index.vue'
import BedManage from '@/views/elderlyInstitute/roomManagement/index.vue'
import serviceOrg from '@/views/datacenter/basicData/serviceOrg/index.vue'
import { tableConfig } from './config'
import { tableConfig as bedTableConfig } from '@/views/elderlyInstitute/roomManagement/BedPage/config'

const activeName = ref(1)
const tabsList = [
	{ label: '养老机构', value: 1, compont: serviceOrg, tableConfig: tableConfig },
	{ label: '床位管理', value: 2, compont: BedManage, tableConfig: bedTableConfig },
	// {
	// 	label: '目标值',
	// 	value: 3,
	// 	baseConfig: TargetValue,
	// 	paramsObj: {
	// 		contentType: '7',
	// 		contentTypeLabel: '新增养老机构床位目标值',
	// 	},
	// },
]

const activeItem = computed(() => {
	return tabsList.find((item) => item.value === activeName.value) || {}
})
</script>

<style lang="scss" scoped></style>
